﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="UpdateDisbursementList.aspx.cs" Inherits="Stationery_Store_Inventory_Management.UpdateDisbursementList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1
        {
            height: 40px;
        }
        .auto-style2 {
            width: 153px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div align="center">
        <h2>Update Disbursement List</h2>
        <p>&nbsp;</p>
    
        <table class="table-condensed">
            <tr>
                <td class="auto-style1">
                    <asp:Label ID="Label2" runat="server" Text="Collection Point"></asp:Label>
                </td>
                <td class="auto-style1">
                    <asp:DropDownList runat="server" ID="CollectionPointddl" AutoPostBack="True" CssClass="form-control" Width="320px"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="auto-style1">
                    <asp:Label ID="Label3" runat="server" Text="Category"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList runat="server" ID="Categoryddl" AutoPostBack="True"
            onselectedindexchanged="Categoryddl_SelectedIndexChanged" CssClass="form-control" Width="142px"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="auto-style1">
                    <asp:Label ID="Label4" runat="server" Text="Item Name"></asp:Label>
                </td>
                <td>
                     <asp:DropDownList runat="server" ID="ItemNameddl" CssClass="form-control" Width="320px"></asp:DropDownList>
                </td>
            </tr>
            <tr><td colspan="2">&nbsp;</td></tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Search" CssClass="btn-info" CausesValidation="False" />
                </td>
            </tr>
        </table>
        <hr />
        <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="List" ForeColor="Red" ValidationGroup="AdjustGrp" />
        <br />
        <br />
        <table>            
            <tr>
                <td>
                     <asp:Label ID="Label5" runat="server" Text="Please specify the missing or damaged quantity" Visible="False"></asp:Label>
                </td>
                <td width="150px">
                    <asp:TextBox ID="txtAdjusmentQty" runat="server" Visible="False" CssClass="form-control"></asp:TextBox>
                   </td>
                <td> 
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="* Please enter a value" ControlToValidate="txtAdjusmentQty" ForeColor="Red" ValidationGroup="AdjustGrp">*</asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="* Adjustment Qty must be at least 1" ControlToValidate="txtAdjusmentQty" ForeColor="Red" MaximumValue="2147483647" MinimumValue="1" Type="Integer" ValidationGroup="AdjustGrp">*</asp:RangeValidator>
                </td>
            </tr>           
        </table>
        <br />
        <asp:GridView ID="DeptQtyGrid" runat="server" CssClass="table table-hover table-striped table-bordered table-condensed" Width="80%">
            <Columns>
                <%--<asp:ButtonField Text="Allocate" CommandName="btnAllocate" />
                --%><asp:TemplateField HeaderText="Allocate Qty">
                    <ItemTemplate>
                        <asp:TextBox ID="ActualQty" Text='<%# Eval("ActualQty")%>' runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="* Please enter a value" ControlToValidate="ActualQty" ForeColor="Red" Text="*" ValidationGroup="AdjustGrp"></asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="RangeValidator2" runat="server" ErrorMessage="* Allocated Qty must be at least 0" ControlToValidate="ActualQty" ForeColor="Red" MinimumValue="0" MaximumValue="2147483647" Text="*" Type="Integer" ValidationGroup="AdjustGrp"></asp:RangeValidator>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <br />
        <asp:Button ID="btnAllocate" runat="server" Text="Allocate" OnClick="btnAllocate_Click" CssClass="btn-primary" ValidationGroup="AdjustGrp" />
        <br />
        <br />
    </div>

</asp:Content>